/*
 * Copyright 2007 Xplayat, S.L. All rights reserved.
 * Propiedad de Xplayat. 
 */
package facelets.component;

import org.apache.myfaces.component.html.ext.HtmlPanelGroup;

import com.sun.facelets.tag.jsf.ComponentConfig;
import com.sun.facelets.tag.jsf.ComponentHandler;

/**
 * @author nachoe
 *
 */
public class ToolbarComponentHandler extends ComponentHandler { // NO_UCD
	
	
	public ToolbarComponentHandler(ComponentConfig cfg) {
		super(cfg);
	}
	
	
	/* (non-Javadoc)
	 * @see com.sun.facelets.tag.MetaTagHandler#setAttributes(com.sun.facelets.FaceletContext, java.lang.Object)
	 */
	public void setAttributes(com.sun.facelets.FaceletContext ctx, Object instance) {
		HtmlPanelGroup t = (HtmlPanelGroup) instance;
		
		if ( getAttribute ("colspan") == null ) 
			t.setColspan(6);
		
		t.setStyleClass("toolbar");
		
		super.setAttributes(ctx, instance);
	}
}